package highTech.javaBean;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.PropertyUtils;

public class BeanUtilTest {
	public static void main(String[] args) throws Exception{
		ReflectBean fb=new ReflectBean(3,5);
		
		//BeanUtils
		System.out.println(BeanUtils.getProperty(fb, "x"));
		System.out.println(BeanUtils.getProperty(fb, "x").getClass().getName());
		BeanUtils.setProperty(fb, "x", "9");//������Դ���һ���ַ�
		System.out.println(fb.getX());
		
		BeanUtils.setProperty(fb, "birthday.time", "111");
		System.out.println(BeanUtils.getProperty(fb, "birthday.time"));
		
		//PropertyUtils
		//PropertyUtils.setProperty(fb, "x", "9");
		PropertyUtils.setProperty(fb, "x", 9);
		System.out.println(PropertyUtils.getProperty(fb, "x").getClass().getName());
	}

}
